package com.likeyoudo.views.api.xg;

import com.likeyoudo.common.core.BaseApi;
import com.likeyoudo.views.utils.HttpRequest;

import java.util.Map;

import okhttp3.RequestBody;

/**
 * @author LikeYouDo
 * @date 2023/12/20 23:16
 */
public class ApprovalApi extends BaseApi {
    private String uri = "/xg/approval/";

    public ApprovalApi() {
    }

    public ApprovalApi(String uri) {
        this.uri = uri;
    }

    public String getUri() {
        return uri;
    }

    public void setUri(String uri) {
        this.uri = uri;
    }

    public void list(Map<String,String> queryParams) {
        HttpRequest.get(listMsgType(), this.uri + "list", queryParams);
    }

    public void get(String pathParams) {
        HttpRequest.get(getMsgType(), this.uri + pathParams);
    }

    public void add(RequestBody data) {
        HttpRequest.post(addMsgType(), this.uri, data);
    }

    public void update(RequestBody data) {
        HttpRequest.put(updateMsgType(), this.uri, data);
    }

    public void delete(String pathParams) {
        HttpRequest.delete(deleteMsgType(), this.uri + pathParams);
    }
}
